*Qatar Birthdays Analysis

clear

cd ~/Desktop/

import delimited "UNdata_Export_20180617_111814093.csv"

keep if count == "Qatar"
mean value if month~="Total"
drop if year=="2012"


gen month_code=1 if regexm(month, "Jan")
replace month_code=2 if regexm(month, "Feb")
replace month_code=3 if regexm(month, "Mar")
replace month_code=4 if regexm(month, "Apr")
replace month_code=5 if regexm(month, "May")
replace month_code=6 if regexm(month, "June")
replace month_code=7 if regexm(month, "July")
replace month_code=8 if regexm(month, "Aug")
replace month_code=9 if regexm(month, "Sep")
replace month_code=10 if regexm(month, "Oct")
replace month_code=11 if regexm(month, "Nov")
replace month_code=12 if regexm(month, "Dec")

label def month_code 1 "January" 2 "February" 3 "March" 4 "April" ///
5 "May" 6 "June" 7 "July" 8 "August" 9 "September" 10 "October" ///
11 "November" 12 "December" 

label val month_code month_code

mean value if month_code<6 | month_code==12
mean value if month_code>5 & month_code<12

gen half = 0 if month_code<6 | month_code==12
replace half = 1 if month_code>5 & month_code<12

cd ~/Desktop/Results/

graph hbar value if month~="Total" & month_code<1300, over(month_code) ///
	bar(1, bcolor(gs8)) yline(1174.13, lcolor(black)) ytitle(Mean Births/Month) ///
	yscale(range(0(200) 1300) titlegap(1)) xsize(4.5) ylabel(, nogrid)
	
graph export Birthday_Distribution.png, as(png) replace

